Why am I getting an UnboundLocalError in my Python regex function for parsing logs

visit shbcf.ru